From 9d2ae63e8b59fec769cef12536319dedb199f5cb Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 24 Feb 2009 21:17:27 +0000 Subject: [PATCH] based on a patch from Gary V. Vaughan, include "config.h" before any other 2009-02-24 Sven Neumann * */*.c: based on a patch from Gary V. Vaughan, include "config.h" before any other header file from all .c files. * babl/babl-internal.h * extensions/util.h: instead of including config.h from here, bail out if it wasn't included beforehand. svn path=/trunk/; revision=394 --- ChangeLog | 9 +++++++++ babl/babl-component.c | 1 + babl/babl-conversion.c | 1 + babl/babl-core.c | 1 + babl/babl-cpuaccel.c | 1 - babl/babl-db.c | 1 + babl/babl-extension.c | 2 -- babl/babl-fish-path.c | 1 + babl/babl-fish-reference.c | 1 + babl/babl-fish-simple.c | 1 + babl/babl-fish-stats.c | 1 + babl/babl-fish.c | 1 + babl/babl-format.c | 1 + babl/babl-hash-table.c | 1 + babl/babl-image.c | 1 + babl/babl-internal.c | 1 + babl/babl-internal.h | 6 ++++-- babl/babl-introspect.c | 1 + babl/babl-list.c | 1 + babl/babl-memory.c | 1 + babl/babl-model.c | 1 + babl/babl-sampling.c | 1 + babl/babl-sanity.c | 1 + babl/babl-type.c | 1 + babl/babl-util.c | 1 + babl/babl-version.c | 1 + babl/babl.c | 1 + babl/base/babl-base.c | 1 + babl/base/formats.c | 1 + babl/base/model-gray.c | 1 + babl/base/model-rgb.c | 1 + babl/base/model-ycbcr.c | 1 + babl/base/type-float.c | 1 + babl/base/type-u16.c | 1 + babl/base/type-u32.c | 1 + babl/base/type-u8.c | 1 + babl/gettimeofday.c | 1 + extensions/CIE-Lab.c | 1 + extensions/gegl-fixups.c | 1 + extensions/gggl-lies.c | 1 + extensions/gggl.c | 1 + extensions/gimp-8bit.c | 1 + extensions/naive-CMYK.c | 1 - extensions/util.h | 4 +++- tests/babl-html-dump.c | 1 + tests/babl_class_name.c | 1 + tests/babl_fish_path_dhtml.c | 1 + tests/babl_fish_path_fitness.c | 1 + tests/conversions.c | 1 + tests/formats.c | 1 + tests/grayscale_to_rgb.c | 1 + tests/introspect.c | 1 + tests/models.c | 1 + tests/nop.c | 1 + tests/rgb_to_bgr.c | 1 + tests/rgb_to_ycbcr.c | 1 + tests/sanity.c | 1 + tests/srgb_to_lab_u8.c | 1 + tests/types.c | 1 + 59 files changed, 69 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86a7be4..dad6231 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-02-24 Sven Neumann + + * */*.c: based on a patch from Gary V. Vaughan, include "config.h" + before any other header file from all .c files. + + * babl/babl-internal.h + * extensions/util.h: instead of including config.h from here, bail + out if it wasn't included beforehand. + 2009-02-20 Martin Nordholts * babl/babl.h: Include headers in babl.h as system headers diff --git a/babl/babl-component.c b/babl/babl-component.c index 45a9b0a..301e64d 100644 --- a/babl/babl-component.c +++ b/babl/babl-component.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" #include "babl-db.h" #include diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c index bcb80cb..e08b2e6 100644 --- a/babl/babl-conversion.c +++ b/babl/babl-conversion.c @@ -17,6 +17,7 @@ */ +#include "config.h" #include #include #include diff --git a/babl/babl-core.c b/babl/babl-core.c index 91a59f2..f66b191 100644 --- a/babl/babl-core.c +++ b/babl/babl-core.c @@ -15,6 +15,7 @@ * . */ +#include "config.h" #include #include "babl-internal.h" #include "babl-ids.h" diff --git a/babl/babl-cpuaccel.c b/babl/babl-cpuaccel.c index e43c99e..a4202f2 100644 --- a/babl/babl-cpuaccel.c +++ b/babl/babl-cpuaccel.c @@ -28,7 +28,6 @@ */ #include "config.h" - #include #include #include diff --git a/babl/babl-db.c b/babl/babl-db.c index 0b10daf..74413d8 100644 --- a/babl/babl-db.c +++ b/babl/babl-db.c @@ -23,6 +23,7 @@ #define _BABL_DB_C +#include "config.h" #include #include "babl-internal.h" diff --git a/babl/babl-extension.c b/babl/babl-extension.c index e8866ac..1788bbd 100644 --- a/babl/babl-extension.c +++ b/babl/babl-extension.c @@ -18,9 +18,7 @@ #define BABL_DYNAMIC_EXTENSIONS -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #define BABL_PATH LIBDIR BABL_DIR_SEPARATOR BABL_LIBRARY diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 038aaaa..b6a6582 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-internal.h" diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c index 6f8253d..0b1cc27 100644 --- a/babl/babl-fish-reference.c +++ b/babl/babl-fish-reference.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" static Babl * diff --git a/babl/babl-fish-simple.c b/babl/babl-fish-simple.c index ecd6d0d..36908aa 100644 --- a/babl/babl-fish-simple.c +++ b/babl/babl-fish-simple.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" static char * diff --git a/babl/babl-fish-stats.c b/babl/babl-fish-stats.c index efae3d4..a6c6980 100644 --- a/babl/babl-fish-stats.c +++ b/babl/babl-fish-stats.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" static FILE *output_file = NULL; diff --git a/babl/babl-fish.c b/babl/babl-fish.c index a7b5cf7..c446e36 100644 --- a/babl/babl-fish.c +++ b/babl/babl-fish.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" #include #include diff --git a/babl/babl-format.c b/babl/babl-format.c index a9f6878..f3fe36b 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/babl-hash-table.c b/babl/babl-hash-table.c index c48d48d..a468d4a 100644 --- a/babl/babl-hash-table.c +++ b/babl/babl-hash-table.c @@ -20,6 +20,7 @@ * Copyright (C) 2008, Jan Heller */ +#include "config.h" #include "babl-internal.h" #define BABL_HASH_TABLE_INITIAL_MASK 0x7F diff --git a/babl/babl-image.c b/babl/babl-image.c index eb1f6ff..f54c87e 100644 --- a/babl/babl-image.c +++ b/babl/babl-image.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include diff --git a/babl/babl-internal.c b/babl/babl-internal.c index 8fd7fba..596e268 100644 --- a/babl/babl-internal.c +++ b/babl/babl-internal.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-internal.h" diff --git a/babl/babl-internal.h b/babl/babl-internal.h index 7baf910..a43bb7b 100644 --- a/babl/babl-internal.h +++ b/babl/babl-internal.h @@ -19,6 +19,10 @@ #ifndef _BABL_INTERNAL_H #define _BABL_INTERNAL_H +#ifndef BABL_LIBRARY +#error "config.h must be included prior to babl-internal.h" +#endif + #ifdef _BABL_H #error babl-internal.h included after babl.h #endif @@ -36,8 +40,6 @@ #include "babl.h" #define _BABL_INTERNAL_H -#include "config.h" - #include "babl-class.h" #include "babl-classes.h" #include "babl-introspect.h" diff --git a/babl/babl-introspect.c b/babl/babl-introspect.c index 20adb56..34cf9b4 100644 --- a/babl/babl-introspect.c +++ b/babl/babl-introspect.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" /* for babl_log */ #define BABL_LOG diff --git a/babl/babl-list.c b/babl/babl-list.c index 8e539af..898e8c5 100644 --- a/babl/babl-list.c +++ b/babl/babl-list.c @@ -20,6 +20,7 @@ * Copyright (C) 2008, Jan Heller */ +#include "config.h" #include "babl-internal.h" #define BABL_LIST_INITIAL_SIZE 0x7F diff --git a/babl/babl-memory.c b/babl/babl-memory.c index adaece4..ea6e65d 100644 --- a/babl/babl-memory.c +++ b/babl/babl-memory.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/babl-model.c b/babl/babl-model.c index e7e59ca..c78f1d8 100644 --- a/babl/babl-model.c +++ b/babl/babl-model.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/babl-sampling.c b/babl/babl-sampling.c index 2698f8f..d3fa637 100644 --- a/babl/babl-sampling.c +++ b/babl/babl-sampling.c @@ -21,6 +21,7 @@ #define VERTICAL_MIN 1 #define VERTICAL_MAX 4 +#include "config.h" #include "babl-internal.h" static BablSampling sampling_db[(HORIZONTAL_MAX - HORIZONTAL_MIN + 1) * diff --git a/babl/babl-sanity.c b/babl/babl-sanity.c index 5f9e8ee..5eb74b4 100644 --- a/babl/babl-sanity.c +++ b/babl/babl-sanity.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" static int OK; diff --git a/babl/babl-type.c b/babl/babl-type.c index a1537ac..c150e2c 100644 --- a/babl/babl-type.c +++ b/babl/babl-type.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/babl-util.c b/babl/babl-util.c index e79e1b8..6abcd43 100644 --- a/babl/babl-util.c +++ b/babl/babl-util.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-internal.h" diff --git a/babl/babl-version.c b/babl/babl-version.c index b1805ef..81e4efd 100644 --- a/babl/babl-version.c +++ b/babl/babl-version.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" diff --git a/babl/babl.c b/babl/babl.c index 91ccb17..08c4345 100644 --- a/babl/babl.c +++ b/babl/babl.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" static int ref_count = 0; diff --git a/babl/base/babl-base.c b/babl/base/babl-base.c index d8cbbf6..1271a43 100644 --- a/babl/base/babl-base.c +++ b/babl/base/babl-base.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-base.h" extern int babl_hmpf_on_name_lookups; diff --git a/babl/base/formats.c b/babl/base/formats.c index 212b86a..5e6e0c0 100644 --- a/babl/base/formats.c +++ b/babl/base/formats.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-classes.h" diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c index f46eb59..e6b907c 100644 --- a/babl/base/model-gray.c +++ b/babl/base/model-gray.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-classes.h" diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c index da772c7..46e443b 100644 --- a/babl/base/model-rgb.c +++ b/babl/base/model-rgb.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include diff --git a/babl/base/model-ycbcr.c b/babl/base/model-ycbcr.c index dc766ec..c4f6ab9 100644 --- a/babl/base/model-ycbcr.c +++ b/babl/base/model-ycbcr.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/base/type-float.c b/babl/base/type-float.c index b8f7620..ce7e407 100644 --- a/babl/base/type-float.c +++ b/babl/base/type-float.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include diff --git a/babl/base/type-u16.c b/babl/base/type-u16.c index 1ff4bc2..c09fe0f 100644 --- a/babl/base/type-u16.c +++ b/babl/base/type-u16.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/base/type-u32.c b/babl/base/type-u32.c index f62d043..aa168d1 100644 --- a/babl/base/type-u32.c +++ b/babl/base/type-u32.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/base/type-u8.c b/babl/base/type-u8.c index 29bd896..66b6412 100644 --- a/babl/base/type-u8.c +++ b/babl/base/type-u8.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include diff --git a/babl/gettimeofday.c b/babl/gettimeofday.c index 33bf926..6640abc 100644 --- a/babl/gettimeofday.c +++ b/babl/gettimeofday.c @@ -6,6 +6,7 @@ * By Wu Yongwei * */ +#include "config.h" #ifdef _WIN32 diff --git a/extensions/CIE-Lab.c b/extensions/CIE-Lab.c index 47cbbd5..c4b4a52 100644 --- a/extensions/CIE-Lab.c +++ b/extensions/CIE-Lab.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include diff --git a/extensions/gegl-fixups.c b/extensions/gegl-fixups.c index df4676a..4ee87a8 100644 --- a/extensions/gegl-fixups.c +++ b/extensions/gegl-fixups.c @@ -41,6 +41,7 @@ #include +#include "config.h" #include "babl.h" #include "base/util.h" diff --git a/extensions/gggl-lies.c b/extensions/gggl-lies.c index 0fcfd7b..b93d47c 100644 --- a/extensions/gggl-lies.c +++ b/extensions/gggl-lies.c @@ -23,6 +23,7 @@ * Copyright 2003, 2004, 2005 Øyvind Kolås */ +#include "config.h" #include #include diff --git a/extensions/gggl.c b/extensions/gggl.c index e24e51c..faf28ec 100644 --- a/extensions/gggl.c +++ b/extensions/gggl.c @@ -21,6 +21,7 @@ * Copyright 2003, 2004, 2005 Øyvind Kolås */ +#include "config.h" #include #include diff --git a/extensions/gimp-8bit.c b/extensions/gimp-8bit.c index 7868cb8..cd6b89f 100644 --- a/extensions/gimp-8bit.c +++ b/extensions/gimp-8bit.c @@ -19,6 +19,7 @@ * . */ +#include "config.h" #include #include "babl.h" diff --git a/extensions/naive-CMYK.c b/extensions/naive-CMYK.c index 783df34..75723da 100644 --- a/extensions/naive-CMYK.c +++ b/extensions/naive-CMYK.c @@ -17,7 +17,6 @@ */ #include "config.h" - #include #include diff --git a/extensions/util.h b/extensions/util.h index 1e6b070..cb872f8 100644 --- a/extensions/util.h +++ b/extensions/util.h @@ -22,7 +22,9 @@ #include #include -#include "config.h" +#ifndef BABL_LIBRARY +#error "config.h must be included prior to util.h" +#endif #ifndef HAVE_RINT # define rint(f) (floor (((double) (f)) + 0.5)) diff --git a/tests/babl-html-dump.c b/tests/babl-html-dump.c index 1f3def8..4c01611 100644 --- a/tests/babl-html-dump.c +++ b/tests/babl-html-dump.c @@ -17,6 +17,7 @@ * */ +#include "config.h" #include "babl-internal.h" /* needed for babl_log */ static void model_html (Babl *babl); diff --git a/tests/babl_class_name.c b/tests/babl_class_name.c index 01e1c41..8a7bab1 100644 --- a/tests/babl_class_name.c +++ b/tests/babl_class_name.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include #include "babl-internal.h" diff --git a/tests/babl_fish_path_dhtml.c b/tests/babl_fish_path_dhtml.c index b9f52f5..b9bcadf 100644 --- a/tests/babl_fish_path_dhtml.c +++ b/tests/babl_fish_path_dhtml.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include "babl-internal.h" diff --git a/tests/babl_fish_path_fitness.c b/tests/babl_fish_path_fitness.c index 9ac312f..7090b4b 100644 --- a/tests/babl_fish_path_fitness.c +++ b/tests/babl_fish_path_fitness.c @@ -1,6 +1,7 @@ /* perform a symmetricality of conversion test on a set of randomized * RGBA data */ +#include "config.h" #include #include #include "babl-internal.h" diff --git a/tests/conversions.c b/tests/conversions.c index 9efe2c6..946bfb9 100644 --- a/tests/conversions.c +++ b/tests/conversions.c @@ -1,6 +1,7 @@ /* perform a symmetricality of conversion test on a set of randomized * RGBA data */ +#include "config.h" #include #include #include "babl-internal.h" diff --git a/tests/formats.c b/tests/formats.c index a3852f7..8f481bb 100644 --- a/tests/formats.c +++ b/tests/formats.c @@ -1,6 +1,7 @@ /* perform a symmetricality of conversion test on a set of randomized * RGBA data */ +#include "config.h" #include #include #include "babl-internal.h" diff --git a/tests/grayscale_to_rgb.c b/tests/grayscale_to_rgb.c index f73d186..8e004b9 100644 --- a/tests/grayscale_to_rgb.c +++ b/tests/grayscale_to_rgb.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" #define PIXELS 5 diff --git a/tests/introspect.c b/tests/introspect.c index fb5b8fc..b52ed9f 100644 --- a/tests/introspect.c +++ b/tests/introspect.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" int diff --git a/tests/models.c b/tests/models.c index 1922a35..2920c2f 100644 --- a/tests/models.c +++ b/tests/models.c @@ -1,6 +1,7 @@ /* perform a symmetricality of conversion test on a set of randomized * RGBA data */ +#include "config.h" #include #include #include "babl-internal.h" diff --git a/tests/nop.c b/tests/nop.c index 883d9d8..7d79dc4 100644 --- a/tests/nop.c +++ b/tests/nop.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl.h" int diff --git a/tests/rgb_to_bgr.c b/tests/rgb_to_bgr.c index ddbadeb..51986ee 100644 --- a/tests/rgb_to_bgr.c +++ b/tests/rgb_to_bgr.c @@ -17,6 +17,7 @@ */ +#include "config.h" #include #include "babl-internal.h" diff --git a/tests/rgb_to_ycbcr.c b/tests/rgb_to_ycbcr.c index 2665098..6efc796 100644 --- a/tests/rgb_to_ycbcr.c +++ b/tests/rgb_to_ycbcr.c @@ -17,6 +17,7 @@ */ +#include "config.h" #include #include "babl-internal.h" diff --git a/tests/sanity.c b/tests/sanity.c index 482f218..d0141c8 100644 --- a/tests/sanity.c +++ b/tests/sanity.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include "babl-internal.h" int diff --git a/tests/srgb_to_lab_u8.c b/tests/srgb_to_lab_u8.c index 8d7c7b7..d3af0dd 100644 --- a/tests/srgb_to_lab_u8.c +++ b/tests/srgb_to_lab_u8.c @@ -16,6 +16,7 @@ * . */ +#include "config.h" #include #include "babl-internal.h" diff --git a/tests/types.c b/tests/types.c index 9e53d24..1b86cea 100644 --- a/tests/types.c +++ b/tests/types.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include "babl-internal.h" -- 2.30.2